package com.fuhe.chen.vendingmachine.service;

import com.fuhe.chen.vendingmachine.dto.UserDto;
import com.fuhe.chen.vendingmachine.pojo.Machine;
import com.fuhe.chen.vendingmachine.pojo.RelationshipSupplierMachine;
import com.fuhe.chen.vendingmachine.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用户服务层
 */
public interface IUserService {

    /**
     * 新增用户
     */
    void addUser(User user);

    /**
     * 查询所有用户
     * @return
     */
    List<User> findAll();

    /**
     * 根据用户名查询单个用户
     * @param name
     * @return
     */
    User findOne(String name);

    /**
     * 根据用户id查询单个用户
     * @param name
     * @return
     */
    UserDto findUserInfoById(String name);

    /**
     * 根据id查询单个用户
     * @param user_id
     * @return
     */
    User findById( String user_id);


    /**
     * 检查用户是否重复
     * @param name
     * @return
     */
    Boolean userCheck(String name);

    String empower(String user_id, String role);

    String distributeMachine(String supplier_id, Integer machine_id);

    void takeBackMachine(Integer relationship_id);

    RelationshipSupplierMachine getRelationshipByMachineId(Integer machine_id);

    List<Machine> getMachineListBySupplierId(String supplier_id);
}
